<%-- 
    Document   : myReportList
    Created on : Aug 31, 2012, 3:40:13 PM
    Author     : phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <f:view>
            <a href="freeLab.jsp">Free Lab</a>&nbsp;|&nbsp;
            <a href="mySignList.jsp">My Sign</a>&nbsp;|&nbsp;
            <a href="report.jsp">Send Report</a>&nbsp;|&nbsp;
            <a href="myReportList.jsp">My Report</a>
            <h1>My Report List</h1>  
            <h:form id="reportList">                   
                <h:dataTable var="report" value="#{reportListBean.reportByUser}" border="1" >
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Id"/>
                        </f:facet>
                        <h:commandLink value="#{report.id}" action="reportInfo" 
                                       actionListener="#{reportBean.getReportByID(report.id)}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Device ID"/>
                        </f:facet><h:commandLink value="#{report.device.id}" action="deviceInfo" 
                                       actionListener="#{deviceBean.getDeviceByID(report.device.id)}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Lab ID"/>
                        </f:facet>
                        <h:commandLink value="#{report.device.lab.id}" action="labInfo" 
                                       actionListener="#{labBean.getLabByID(report.device.lab.id)}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Create Date"/>
                        </f:facet>
                        <h:outputText value="#{report.createDate}">
                            <f:convertDateTime pattern="HH:mm MM/dd/yyyy" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Tilte"/>
                        </f:facet>
                        <h:outputText value="#{report.title}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Status"/>
                        </f:facet>
                        <h:outputText value="#{report.status}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
        </f:view>
    </body>
</html>
